package com.huikeportal.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huikeportal.controller.common.Log;
import com.huikeportal.dao.RoleMapper;
import com.huikeportal.model.WordBook;
import com.huikeportal.model.common.InterFaceModel;
import com.huikeportal.model.common.SqlParameter;
import com.huikeportal.service.InterFaceCommon;

@Service("interFaceCommon")
public class InterFaceCommonImpl implements InterFaceCommon {

	@Autowired
	private RoleMapper roleMapper;

	public void logInterface(InterFaceModel interFaceModel) {
		Log log = Log.getLogger();
		log.logger.info("****************************************");
		log.logger.info("接口名称:" + interFaceModel.getInterName());
		log.logger.info("接口开始时间:" + interFaceModel.getStartTime());
		log.logger.info("接口结束时间:" + interFaceModel.getEndTime());
		log.logger.info("接口运行结果:" + interFaceModel.getInterStatus());
		log.logger.info("****************************************");
	}

	// 获取字典表信息
	public List<WordBook> getWordBookList(String sysLang, String dicKey)
			throws Exception {
		SqlParameter sql = new SqlParameter();
		sql.setString(dicKey);
		sql.setSysLang(sysLang);
		return roleMapper.getButtonInfo(sql);
	}

}
